import jdk.nashorn.internal.ir.CallNode;

import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.List;

/**
 * Email ：huangyijia138@qq.com
 * Des：
 *
 * @description: 应用
 * @author: huangjiajia
 * @create: 2025-01-19 09:32
 **/
public class EmployeeFile {
    public static void main(String[] args) {
        Employee employee = new Employee();
        employee.setName("张三");
        employee.setAge(18);
        employee.setTelephone(123456);

        Employee employee2 = new Employee();
        employee2.setName("张二");
        employee2.setAge(18);
        employee2.setTelephone(123456);

        Employee employee3 = new Employee();
        employee3.setName("张三");
        employee3.setAge(18);
        employee3.setTelephone(123456);


        ArrayList<Employee> objects = new ArrayList<>();
        objects.add(employee3);
        objects.add(employee2);
        objects.add(employee);


        for (Employee object : objects) {
            System.out.println(object);
            System.out.println(object.getName());
            System.out.println(object.getAge());
            System.out.println(object.getTelephone());
        }



        // 将list进行循环输出
        for (int i = 0; i < objects.size(); i++) {
            System.out.println(objects.get(i).getName());
            System.out.println(objects.get(i).getAge());
            System.out.println(objects.get(i).getTelephone());
        }


        }



    }



